package com.pmstation.skin

/**
 * Created by IntelliJ IDEA.
 * User: denny
 * Date: Jul 7, 2010
 * Time: 2:00:22 PM
 * To change this template use File | Settings | File Templates.
 */

object EasyNotSkin{
  def easyNotSkin(rgb: Int):Boolean={
      val R = ((rgb >> 16) & 0xFF)
      val G = ((rgb >> 8) & 0xFF)
      val B = ((rgb >> 0) & 0xFF)

// R G and B values are presented in the range 0 to 255
    if ( (B > 160 && R < 180 && G < 180) || // Too much blue
         (G > 160 && R < 180 && B < 180) || // Too much green
         (B < 100 && R < 100 && G < 100) || // Too dark
         (G > 200) ) // Green
      true
    else if(
         (R+G > 400) || // Too much red and green (yellow like color)
         (G > 150 && B < 90 ) || // Yellow like also
         (B/(R+G+B) > .40) || // Too much blue in contrast to others
         (G/(R+G+B) > .40) ) // Too much green in contrast to others
      true
    else if( R < 102 && G > 100 && B > 110 && G < 140 && B < 160) // Ocean
      true 
    else false
  }
} 